package com.topvision.common.response;

import java.io.Serializable;

/**
 * @author shengwm
 * @version V0.0.1
 * @Title: SuccessResponse
 * @Package com.topvision.common.vo
 * @Description: TODO
 * @date 2017/4/23
 */
public class SuccessResponse implements Serializable {

    private static final long serialVersionUID = -1538937815959140957L;
    /**
     * 是否请求成功
     */
    protected Boolean success;

    /**
     * 提示消息 "操作成功"
     */
    protected String message;

    private Object data;

    public SuccessResponse() {
        this.success = Boolean.TRUE;
    }

    protected SuccessResponse(final String message, final Object data) {
        this.success = Boolean.TRUE;
        this.message = message;
        this.data = data;
    }

    public static SuccessResponse of(final String message, final Object data) {
        return new SuccessResponse(message, data);
    }

    public static SuccessResponse of( final Object data) {
        return new SuccessResponse("success", data);
    }

    public static SuccessResponse of() {
        return new SuccessResponse("success", "empty");
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
